﻿<script src ="/ticket/scripts/buses.js?v=1.0"></script>
<script src ="scripts/httpService.js"></script>
			<div class="pageheader">
				<h2><i class="fa fa-hand-o-up"></i> 假期班车管理 <span>车次详情</span></h2>
			</div>

			<div class="contentpanel" ng-app="busesApp" ng-controller="busesCtrl">
				<div class="row xg-content">
					<div class="col-xs-12">
						<div class="btn-group">
						    <button type="button" class="btn btn-warning" ng-click="refreshBuses()"><span class="glyphicon glyphicon-refresh"></span> 刷新</button>
						    <button type="button" class="btn btn-primary" ng-click="addBuses()"><span class="glyphicon glyphicon-pencil"></span> 添加</button>
                            						
							<button type="button" class="btn btn-danger" ng-click="deleteBuses()"><span class="glyphicon glyphicon-trash"></span> 删除</button>
							<button type="button" class="btn btn-success" ng-click="updateBuses()"><span class="glyphicon glyphicon-send"></span> 更新</button>    
								
						</div>
						<table class="table table-striped table-hover">
							 <tr>
							            <th>选择</th>
                                        <th>车辆序号</th>
                                        <th>方向</th>
                                        <th>出发时间</th>
                                        <th>生效时间</th>
                                        <th>路线</th>
                                        <th>座位数</th>
                                        <th>已定数</th>
                                        <th>生成时间</th>
                                        <th>备注</th>
                                    </tr>
                                    <tr ng-repeat="bus in buses" ng-click="selectChange($index)">
                                       <td><input type="checkbox" ng-model="bus.checked"/></td>
                                       <td ng-bind="bus.number"></td>
                                       <td ng-if="bus.orientation==0" >成都方向</td>
                                       <td ng-if="bus.orientation==1" >基地方向</td>
                                       <td ng-bind="bus.departuredate"></td>
                                       <td ng-bind="bus.validityDate"></td>
                                       <td ng-bind="bus.routeName"></td>
                                       <td ng-bind="bus.seatcount"></td>
                                       <td ng-bind="bus.occupation"></td>
                                       <td ng-bind="bus.addDate"></td>
                                       <td ng-bind="bus.other"></td>
                                    </tr>                                                                    
						</table>
					</div>
				</div>
<script type="text/ng-template" id="modifyBuses">
	<div class='modal-content'>
        <div class='modal-header'>
        <button type='button' class='close' data-dismiss='modal' ng-click="close()" >&times;</button>
        <h2 class='modal-title' style="padding-left:40%" id='addParkLabel'>班车信息</h2>
        </div>

        <div class='modal-body '>
             <form class='form-horizontal' role='form'>
                  <div class="panel panel-info">
                     <div class="panel-heading">
                     <h3 class="panel-title">
                         
                     </h3>
                 </div>
                <div class="panel-body">
                    <div class='form-group '>
                        <div class="col-sm-2 ">
                            <label class='control-label' style="float:right" >路线</label>
                        </div>
                        <div class='col-sm-8'>
                            <select class="form-control" ng-options="route.id as route.name for route in routes" ng-model="bus.routeid">
                            </select>
                        </div>        
                    </div>
                    <div class='form-group'>                                                
                        <div class="col-sm-2 ">
                            <label class='control-label' style="float:right" >附属车次</label>
                        </div>
                        <div class='col-sm-8'>
                            <select class="form-control" ng-options="busOrder.id as (busOrder.departuredate+'--'+busOrder.orientation) group by busOrder.orientation for busOrder in busOrders" ng-model="bus.busorderid">
                            </select>
                        </div>                     
                    </div>
                    
                     <div class='form-group '>
                        <div class="col-sm-2 ">
                            <label class='control-label' style="float:right" >车号</label>
                        </div>
                        <div class='col-sm-3'>
                            <input class="form-control" ng-model="bus.number"/>
                        </div>     
                        
                        <div class="col-sm-2 ">
                            <label class='control-label' style="float:right" >座位数</label>
                        </div>
                        <div class='col-sm-3'>
                            <input class="form-control" ng-model="bus.seatcount"/>
                        </div>    
                    </div>
                    
                     <div class='form-group'>                                                
                        <div class="col-sm-2 ">
                            <label class='control-label' style="float:right" >备注</label>
                        </div>
                        <div class='col-sm-8'>
                            <input class="form-control"   ng-model="bus.other"/>
                        </div>                     
                    </div>
                </div>
              </form>
        </div>
               
         <div class="alert alert-info" ng-show="loading || submitted">
            <span  ng-show='loading' > <i class="fa fa-spinner"></i></span>
            <span ng-show='submitted'>{{result}}</span>
        </div>
        
        <div class='modal-footer'>
            <button type='button' class='btn btn-default' id="modalCloseBtn" data-dismiss='modal' ng-click="close()">关闭</button>
            <button id="submitParkBtn" type='button'ng-click="submit()" class='btn btn-primary'>提交</button>
        </div>
    </div>
</script>
			</div><!-- contentpanel -->
		</div><!-- mainpanel -->
<script src="js/xg_js.js"></script>
<script>
    createMenu(2);
</script>
	